package com.springmvc.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.springmvc.demo.mapper.BranchPointMapper;
import com.springmvc.demo.model.BranchPoint;
import com.springmvc.demo.model.RolePermission;
import com.springmvc.demo.service.PermissionService;

@RestController
public class TestController {
	@Autowired
	BranchPointMapper branchPointMapper;
	
	@Autowired
	PermissionService permissionServiceImpl;
	
	@PostMapping("/addBranchPoint")
	public String addRole(BranchPoint branchPoint) {
		System.out.println(branchPoint.getPointName());
		
		branchPointMapper.insert(branchPoint);
		return "already add";
	}
	@PostMapping("/addPermissionToRole")
	//@ResponseBody
	public String addPermissionToRole(RolePermission rp) {
		return permissionServiceImpl.addPermissionToRole(rp);
		
	}
}
